// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial

TestCase := Window {
    width: 100phx;
    height: 100phx;
    ti := TextInput {
        input-type: decimal;
    }

    property <bool> input_focused: ti.has_focus;
    property <string> text <=> ti.text;
}

/*
```rust
use slint::platform::Key;

let instance = TestCase::new().unwrap();
slint_testing::send_mouse_click(&instance, 5., 5.);
assert!(instance.get_input_focused());
assert!(instance.get_text().is_empty());

// accept characters as valid decimal only
slint_testing::send_keyboard_char(&instance, 'a', true);
assert!(instance.get_text().is_empty());
slint_testing::send_keyboard_char(&instance, Key::Shift.into(), true);
assert!(instance.get_text().is_empty());
slint_testing::send_keyboard_char(&instance, '-', true);
assert_eq!(instance.get_text(), "-");
slint_testing::send_keyboard_char(&instance, '1', true);
assert_eq!(instance.get_text(), "-1");
slint_testing::send_keyboard_char(&instance, '.', true);
assert_eq!(instance.get_text(), "-1.");
slint_testing::send_keyboard_char(&instance, '0', true);
assert_eq!(instance.get_text(), "-1.0");
```
*/
